<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>播放音乐并跳转</title>
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: pink;
            flex-direction: column;
        }

        .heart-container {
            position: relative;
            width: 100px;
            height: 100px;
            cursor: pointer;
        }

        .heart {
            position: absolute;
            width: 100px;
            height: 100px;
            background-color: red;
            transform: rotate(-45deg);
            animation: heartbeat 1s infinite;
        }

        .heart::before,
        .heart::after {
            content: "";
            position: absolute;
            width: 100px;
            height: 100px;
            background-color: red;
            border-radius: 50%;
        }

        .heart::before {
            top: -50px;
            left: 0;
        }

        .heart::after {
            left: 50px;
            top: 0;
        }

        @keyframes heartbeat {
            0% { transform: scale(1) rotate(-45deg); }
            50% { transform: scale(1.1) rotate(-45deg); }
            100% { transform: scale(1) rotate(-45deg); }
        }

        .text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white;
            font-size: 16px;
            font-weight: bold;
            text-align: center;
        }
    </style>
</head>
<body>

    <div class="heart-container" onclick="playMusicAndRedirect()">
        <div class="heart"></div>
        <div class="text">烟一
            生日快乐</div>
    </div>

    <audio id="bgMusic">
        <source src="yin/bgm.MP3" type="audio/mpeg">
    </audio>

    <script>
        function playMusicAndRedirect() {
            let audio = document.getElementById("bgMusic");
            audio.play();  
            setTimeout(function() {
                window.location.href = "1/index.html"; 
            }, 1000); 
        }
    </script>

</body>
</html>
